package ${basePackageName}.interfaces.feign.fallback;

import ${basePackageName}.interfaces.feign.base.<#if prefixJpa??>${prefixJpa}</#if>${tableClassNamePrefix}Feign;
<#if pkType == 'Integer'>
import ${basePackageName}.interfaces.frm.CommonIntIdFrm;
<#elseif pkType == 'Long'>
import ${basePackageName}.interfaces.frm.CommonLongIdFrm;
<#elseif pkType == 'String'>
import ${basePackageName}.interfaces.frm.CommonStringIdFrm;
</#if>
import ${basePackageName}.interfaces.frm.CommonIntIdFrm;
import ${basePackageName}.interfaces.frm.${tableClassNamePrefix}Frm;
import ${basePackageName}.interfaces.vo.${tableClassNamePrefix}VO;
import ${basePackageName}.interfaces.vo.PageVO;
import ${basePackageName}.interfaces.vo.ResultVO;
import org.springframework.stereotype.Component;

import javax.validation.Valid;
import java.util.List;

/**
* description 表(${tableName})对应的JpaFeign降级处理实现类
*
* @author ${authorName}
* @date ${dateTime}
*/
@Component
public class <#if prefixJpa??>${prefixJpa}</#if>${tableClassNamePrefix}FeignFallback implements <#if prefixJpa??>${prefixJpa}</#if>${tableClassNamePrefix}Feign {

    /**
     * 新增数据
     *
     * @param frm 待新增的frm对象
     * @return 成功返回新增后的VO对象，失败返回null
     */
    @Override
    public ResultVO<${tableClassNamePrefix}VO> insert(@Valid ${tableClassNamePrefix}Frm frm) {
        return null;
    }

    /**
     * 删除数据
     *
     * @param frm 主键frm对象
     * @return 1:删除成功 其他:删除失败
     */
    @Override
    <#if pkType == 'Integer'>
    public ResultVO<Integer> delete(@Valid CommonIntIdFrm frm) {
    <#elseif pkType == 'Long'>
    public ResultVO<Integer> delete(@Valid CommonLongIdFrm frm) {
    <#elseif pkType == 'String'>
    public ResultVO<Integer> delete(@Valid CommonStringIdFrm frm) {
    </#if>
        return null;
    }

    /**
     * 更新数据
     *
     * @param frm 待更新的frm对象
     * @return 成功返回更新后的VO对象，失败返回null
     */
    @Override
    public ResultVO<${tableClassNamePrefix}VO> update(@Valid ${tableClassNamePrefix}Frm frm) {
        return null;
    }

    /**
     * 通过主键查询单条数据
     *
     * @param frm 主键Frm对象
     * @return 成功返回对应ID的VO对象，失败返回null
     */
    @Override
    <#if pkType == 'Integer'>
    public ResultVO<${tableClassNamePrefix}VO> findById(@Valid CommonIntIdFrm frm) {
    <#elseif pkType == 'Long'>
    public ResultVO<${tableClassNamePrefix}VO> findById(@Valid CommonLongIdFrm frm) {
    <#elseif pkType == 'String'>
    public ResultVO<${tableClassNamePrefix}VO> findById(@Valid CommonStringIdFrm frm) {
    </#if>
        return null;
    }

    /**
     * 根据条件获取数据集
     *
     * @param frm 查询条件对象
     * @return 成功返回满足条件的数据集合，失败返回空集合
     */
    @Override
    public ResultVO<List<${tableClassNamePrefix}VO>> getList(@Valid ${tableClassNamePrefix}Frm frm) {
        return null;
    }

    /**
     * 根据条件查询数据分页
     *
     * @param frm 查询条件参数
     * @return 成功返回满足条件的分页，失败返回空页
     */
    @Override
    public ResultVO<PageVO<${tableClassNamePrefix}VO>> getPageInfo(@Valid ${tableClassNamePrefix}Frm frm) {
        return null;
    }
}
